package com.geostar.constructionland.analyse.mapper;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.geostar.constructionland.common.entity.logs.JsydFxrz;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @Author chengan
 * @descri 分析日志展示界面mapper
 */
public interface FxrzAlyMapper extends BaseMapper<JsydFxrz> {

    IPage<JsydFxrz> queryFxrzPage(IPage<JsydFxrz> page, @Param(Constants.WRAPPER) Wrapper<JsydFxrz> jsydFxrzWrapper);

    //获取分析日志全部记录
    List<Map<String, String>> queryFxrzList(Map<String, Object> map);

    //获取分析日志记录总数
    int queryFxrzCount();

    //根据Ywid查询结果
    @Select("  select *" +
            "          from (select tt.ywid," +
            "                 tt.fxlx," +
            "                 tt.fxlx_mapped," +
            "                 tt.error_msg," +
            "                 tt.bz," +
            "                 tt.fxsj," +
            "                 tt.fxjg," +
            "                 tt.fxbs," +
            "                 tt.uniquetaskid," +
            "                 t.mongo_id," +
            "                 t.cost_time" +
            "            from JSYD_FXRZ tt" +
            "            left join log_spt t" +
            "              on tt.fxbs = t.fxbs and tt.fxlx_mapped = t.fxlx) t ${ew.customSqlSegment}")
    List<JsydFxrz> queryJsydFxrzByYwid(@Param(Constants.WRAPPER) Wrapper<JsydFxrz> jsydFxrzWrapper);
}
